//
//  BK_OD_Prompt_Msg.m
//  bestkeep
//
//  Created by TOPTEAM on 2017/3/3.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BK_OD_Prompt_Msg.h"
#import "BK_OD_Color.h"

/**
 日历消息提示
 */
#pragma mark======================BK_OD_Prompt_Msg============================
@implementation BK_OD_Prompt_Msg

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initialize];
    }
    return self;
}

- (void)initialize{
    UIImageView *prompt = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"BKOrder_prompt"]];
    [self addSubview:prompt];
    
    UILabel *promptText = [[UILabel alloc] init];
    promptText.text = @"货权日历中显示的价格均为当日均价";
    promptText.font = UIFontSmall;
    promptText.textColor = kOrderLightGrey1;
    promptText.textAlignment = NSTextAlignmentCenter;
    [self addSubview:promptText];
    
    CGSize textSize = [promptText.text sizeWithAttributes:@{NSFontAttributeName : UIFontSmall}];
    CGFloat betweenX = (textSize.height -2 + textSize.width + 3) / 2.0;
    
    [prompt mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(self.mas_centerX).offset(-betweenX);
        make.width.height.mas_equalTo(textSize.height-2);
    }];
    
    [promptText mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(prompt.mas_right).offset(3);
        make.centerY.mas_equalTo(self);
    }];
}

@end

